package wjh.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import wjh.pojo.Patient;

public interface UserInfoMapper {

    @Select("select * from patient where id=#{value}")
    Patient findUserById(int id);

    @Update("update patient set name=#{name},password=#{password},avatar=#{avatar},age=#{age},sex=#{sex},address=#{address},phone=#{phone} where id=#{id}")
    void updateInfo(Patient patient);

    Patient findUserLogin(@Param("name") String name,@Param("password") String password);

    Patient findUserId(@Param("name")String name,@Param("password") String password);

    @Select("select * from patient where name=#{value}")
    Patient findUserRegister(String name);

    void register(@Param("name") String name,@Param("password") String password);
}
